package com.sky.utils;

import com.sky.entity.Comment;
import com.sky.entity.ManageComment;
import lombok.Data;

@Data
public class CommentConverter {

    public static ManageComment fromComment(Comment comment) {
        ManageComment manageComment = new ManageComment();
        manageComment.setCommentId(Long.toString(comment.getId()));
        manageComment.setPostId(String.valueOf(comment.getBlogId()));
        manageComment.setContent(comment.getContent());
        manageComment.setCreateTime(comment.getCreateTime());
        manageComment.setUpdateTime(comment.getUpdateTime());
        manageComment.setParentId(String.valueOf(comment.getParentId()));
        manageComment.setUserId(String.valueOf(comment.getCreateUser()));
        return manageComment;
    }
}
